package mabs.control;

import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import test.TestAction;

import kjmvc.KJAction;
import kjmvc.KJControl;

public class MabsControl extends KJControl {
	private static final long serialVersionUID = 1L;

	@Override
	protected String doControl(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException,
			SQLException {
		KJAction action = null;
		String forward = DEFAULT_URI;
		String actionCode = request.getParameter("action");
		if(actionCode.equals("write")) {
			action = new TestAction(request, response);
		}
		
		if(action != null)
			forward = action.doAction();
		
//		System.out.println("forward:"+forward);
		return forward;
	}

}
